package Experiment.Text;

public class Triangle extends Graph {
    double side;
    String form;

    public Triangle(double side, String form) {
        this.side = side;
        this.form = form;
    }

    @Override
    public double getPerimeter() {
        return side*3;
    }

    public String show() {
        double x=Math.sqrt(3)/4;
        double s=x*Math.pow(side,2);
        return form+"，面积为"+s;
    }
}

